#ifndef LOBBY_H_
#define LOBBY_H_

#include <iostream>
#include <string>
#include <stdio.h>
#include "jsoncpp/json/json.h"
#include <gtkmm.h>

class ModelColumns : public Gtk::TreeModelColumnRecord
{
public:

  ModelColumns()
    { add(col_nivel); add(col_max); add(col_conectados); add(col_id);}
	Gtk::TreeModelColumn<int> col_nivel;
	Gtk::TreeModelColumn<int> col_max;
	Gtk::TreeModelColumn<int> col_conectados;
	Gtk::TreeModelColumn<int> col_id;
	
};



class Lobby: public Gtk::Window {
ModelColumns columns;
Glib::RefPtr<Gtk::Builder> builder;
Glib::RefPtr<Gtk::ListStore> refListStore;
Gtk::TreeView *treeview;
Gtk::Button *buttonnueva;
Gtk::Button *buttonunirse;
Gtk::Button *buttoncancelar;
Gtk::Button *refrescar;

Gtk::Button *buttonaceptar;
Gtk::Button *buttonsalir;

Gtk::SpinButton *spinnivel;
Gtk::SpinButton *spinmax;

Glib::RefPtr<Gtk::TreeSelection> refTreeSelection;

Json::Value partidasJson;
Json::Value respuesta;
Gtk::Window *windownueva;
Gtk::Window *winlobby;
public:
	Lobby(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& refGlade);
	
	void actualizarPartidas();
	void setPartidasJson(Json::Value partidas);
	void on_buttoncancelar_clicked();
	void on_buttonsalir_clicked();
	void on_selection_changed();
	void on_buttonunirse_clicked();
	void on_buttonnueva_clicked();
	void on_buttonaceptar_clicked();
	Json::Value getRespuesta();
};

#endif
